package org.baixin.constant;

public enum CodeType {
	
	UNKNOWN(0),OK(200),NODATA(201),EXCEPTION(500),ERROR(502);
	
	private int code;
	
	private CodeType(int code) {
		this.code = code;
	}
	 public static CodeType valueOf(int code) {
	    	switch(code) {
	    	case 0 :
	    		return UNKNOWN;
	    	case 200 :
	    		return OK;
	    	case 201 :
	    		return NODATA;
	    	case 500 :
	    		return UNKNOWN;
	    	case 501 :
	    		return EXCEPTION;
	    	case 502 :
	    		return ERROR;
	    	default :
	    		return null;
	    	}
	    }

}
